package org.millioncall.yueyoga.admin.model;

import java.util.Date;

import org.millioncall.openplatform.util.DateTimeUtils;

/**
 * 最小的订单实体
 * 
 * @author zangjinyu
 * 
 */
public class TinyOrderModel {
	private Integer id;
	private Integer buyerId;
	private String buyerName;
	private String officerId;
	private String officerName;
	private Date buyTime;
	private Double money;
	private String productTypes;
	private Double discount;
	private Integer state;
	private String productName;//购买产品名称
	private String products; //购买的产品
	
	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	private String buyType;      //购买类型
	private Double actualMoney;  //实际付款

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getBuyerId() {
		return buyerId;
	}

	public void setBuyerId(Integer buyerId) {
		this.buyerId = buyerId;
	}

	public String getBuyerName() {
		return buyerName == null ? "" : buyerName;
	}

	public void setBuyerName(String buyerName) {
		this.buyerName = buyerName;
	}

	public String getOfficerId() {
		return officerId;
	}

	public void setOfficerId(String officerId) {
		this.officerId = officerId;
	}

	public String getOfficerName() {
		return officerName == null ? "" : this.officerName;
	}

	public void setOfficerName(String officerName) {
		this.officerName = officerName;
	}

	public String getBuyTime() {
		return DateTimeUtils.getInstance().format(this.buyTime,
				"yyyy-MM-dd HH:mm:ss");
	}

	public void setBuyTime(Date buyTime) {
		this.buyTime = buyTime;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public String getBuyType() {
		return buyType;
	}

	public void setBuyType(String buyType) {
		this.buyType = buyType;
	}

	public Double getActualMoney() {
		return actualMoney;
	}

	public void setActualMoney(Double actualMoney) {
		this.actualMoney = actualMoney;
	}

	public Double getDiscount() {
		return discount;
	}

	public void setDiscount(Double discount) {
		this.discount = discount;
	}

	public String getProductTypes() {
		return productTypes;
	}

	public void setProductTypes(String productTypes) {
		String[] type=productTypes.split(",");
		String str="";
		for (int i = 0; i < type.length; i++) {
			if(type[i].equals("101")){
				str = str+"按次数";
			} else if(type[i].equals("102")) {
				str = str+"按时间";
			} else if(type[i].equals("107")) {
				str = str+"按金额";
			} else if(type[i].equals("103")) {
				str = str+"年卡";
			} else if(type[i].equals("104")) {
				str = str+"季卡";
			} else if(type[i].equals("105")) {
				str = str+"月卡";
			}  else if(type[i].equals("106")) {
				str = str+"半月卡";
			} else if(type[i].equals("108")) {
				str = str+"实时扣费";
			}
			if(i<type.length-1){
				str = str+",";
			}
		}
		this.productTypes = str;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public String getProducts() {
		return products;
	}

	public void setProducts(String products) {
		this.products = products;
	}
}
